#pragma once
#include "sys.h"

#define RELAY_VALVE_PIN             GPIO_Pin_3
#define RELAY_WIND_HIGH_PIN         GPIO_Pin_2
#define RELAY_WIND_MEDIUM_PIN       GPIO_Pin_1
#define RELAY_WIND_LOW_PIN          GPIO_Pin_0

#define WIND_AUTO_HIGH_THRESHOLD    5       // 风速自动切换到高速档的阈值
#define WIND_AUTO_MEDIUM_THRESHOLD  3       // 风速自动切换到中速档的阈值
#define WIND_AUTO_LOW_THRESHOLD     1       // 风速自动切换到低速档的阈值

#define RELAY_VALVE_ON()            (P23 = 1)
#define RELAY_VALVE_OFF()           (P23 = 0)

#define RELAY_WIND_HIGH_ON()        (P22 = 1)
#define RELAY_WIND_HIGH_OFF()       (P22 = 0)

#define RELAY_WIND_MEDIUM_ON()      (P21 = 1)
#define RELAY_WIND_MEDIUM_OFF()     (P21 = 0)

#define RELAY_WIND_LOW_ON()         (P20 = 1)
#define RELAY_WIND_LOW_OFF()        (P20 = 0)

void output_init(void);
void wind_output(u8 speed);
void valve_output(u8 isOn);
void output_func(void);